<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Timeentry Details</f:facet>

        <s:decorate id="timeentryid" template="layout/display.xhtml">
            <ui:define name="label">Timeentryid</ui:define>
            <h:outputText value="#{timeentryHome.instance.timeentryid}">
                <f:convertNumber/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="startdatetime" template="layout/display.xhtml">
            <ui:define name="label">Startdatetime</ui:define>
            <h:outputText value="#{timeentryHome.instance.startdatetime}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="enddatetime" template="layout/display.xhtml">
            <ui:define name="label">Enddatetime</ui:define>
            <h:outputText value="#{timeentryHome.instance.enddatetime}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/TimeentryEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty timeentryFrom ? 'TimeentryList' : timeentryFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Job</h:panelGroup>
        </f:facet>
    <div class="association" id="jobParent">

        <h:outputText value="There is no job associated with this timeentry."
                   rendered="#{timeentryHome.instance.job == null}"/>

        <rich:dataTable var="_job"
                   value="#{timeentryHome.instance.job}"
                rendered="#{timeentryHome.instance.job != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="jobTable">
            <h:column>
                <f:facet name="header">Jobname</f:facet>
                <h:outputText value="#{_job.jobname}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewjob"
                     value="View"
                      view="/Job.xhtml">
                    <f:param name="jobJobname"
                           value="#{_job.jobname}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Person</h:panelGroup>
        </f:facet>
    <div class="association" id="personParent">

        <h:outputText value="There is no person associated with this timeentry."
                   rendered="#{timeentryHome.instance.person == null}"/>

        <rich:dataTable var="_person"
                   value="#{timeentryHome.instance.person}"
                rendered="#{timeentryHome.instance.person != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="personTable">
            <h:column>
                <f:facet name="header">Personid</f:facet>
                <h:outputText value="#{_person.personid}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Firstname</f:facet>
                <h:outputText value="#{_person.firstname}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Lastname</f:facet>
                <h:outputText value="#{_person.lastname}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Userpassword</f:facet>
                <h:outputText value="#{_person.userpassword}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewperson"
                     value="View"
                      view="/Person.xhtml">
                    <f:param name="personPersonid"
                           value="#{_person.personid}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Feedbacks</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="feedbacksChildren">

        <h:outputText value="There are no feedbacks associated with this timeentry."
                   rendered="#{empty timeentryHome.feedbacks}"/>

        <rich:dataTable value="#{timeentryHome.feedbacks}"
                       var="_feedback"
                  rendered="#{not empty timeentryHome.feedbacks}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="feedbacksTable">
            <rich:column sortBy="#{_feedback.feedbackid}">
                <f:facet name="header">Feedbackid</f:facet>
                <h:outputText value="#{_feedback.feedbackid}">
                    <f:convertNumber/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_feedback.text}">
                <f:facet name="header">Text</f:facet>
                <h:outputText value="#{_feedback.text}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectfeedback"
                     value="Select"
                      view="/Feedback.xhtml">
                    <f:param name="feedbackFeedbackid"
                            value="#{_feedback.feedbackid}"/>
                    <f:param name="feedbackFrom" value="Timeentry"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add feedback"
                view="/FeedbackEdit.xhtml">
            <f:param name="timeentryTimeentryid"
                    value="#{timeentryHome.instance.timeentryid}"/>
            <f:param name="feedbackFrom" value="Timeentry"/>
        </s:button>
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
